package com.jlkf.common.redis.service.impl;


import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;


public class JedisTest {

	@Test
	public void testSpringJedisCluster() {
		ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:spring/spring-*.xml");
		JedisPool jedisCluster =  (JedisPool) applicationContext.getBean("redisClient");
		Jedis jedis = jedisCluster.getResource();
		jedis.set("a", "1");
		String string =jedis.get("a");
		System.out.println(string);	
		jedis.close();
			jedisCluster.close();
	}

}
